// 获取三级分类的接口函数文件
import request from '@/utils/request'
// 引入限制
import type {categoryStateModel,categoryListModel} from './model/categoryModel'
// 定义枚举
enum Api {
  category1IdList = '/admin/product/getCategory1' ,
  category2IdList = '/admin/product/getCategory2' ,
  category3IdList = `/admin/product/getCategory3` ,

}
// 一级接口
export const reqGetCategory1IdList = () => {
  return request.get<any,categoryListModel>(Api.category1IdList)
}

// 二级接口
export const reqGetCategory2IdList = (category1Id:number) => {
  return request.get<any,categoryStateModel>(`${Api.category2IdList}/${category1Id}`)
}

// 三级
export const reqGetCategory3IdList = (category2Id:number) => {
  return request.get<any,categoryStateModel>(`${Api.category3IdList}/${category2Id}`)
}

